package LuMin.file.Text;

import javax.imageio.stream.ImageInputStream;
import java.io.*;
import java.util.Locale;
import java.util.Scanner;

/**
 * @author lumin
 * @date 2022/05/09 20:37
 **/
public class text {
    public static void main(String[] args) throws IOException {
        try(InputStream is = new FileInputStream("src.txt")){
            try(Scanner scanner = new Scanner(is,"UTF-8")){
                try(OutputStream os = new FileOutputStream("derc.txt")){
                    try(Writer writer = new OutputStreamWriter(os,"UTF-8")){
                        try(PrintWriter printWriter = new PrintWriter(writer)){
                            while(scanner.hasNextLine()){
                                String line = scanner.nextLine();
                                String replace = line.replace("**","我儿子");
                                printWriter.println(replace);
                            }

                            printWriter.flush();
                        }
                    }
                }
            }
        }
    }
}